package org.wmq.skyserver.mapper;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.wmq.skycommon.pojo.entity.Order;

import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;

@Mapper
public interface OrderMapper {
    @Insert("")
    public abstract void insert();

    @Select("select * from order where status = #{status} and order_time < #{time}")
    public List<Order> getByStatusAndOrderTime(Integer status, LocalDateTime time);

    @Update("")
    public abstract void update(Order order);

    @Select("select * from sky_take_out.orders where id = #{orderId}")
    public abstract Order getbyId(Integer orderId);

    public abstract Double sumByMap(Map<String, Object> map);
}
